package student.aistar.day06;

public class Animal {
    //父类中定义子类类中共有的属性
    private String name;//动物的名称

    public Animal() {
        System.out.println("Animal得空参构造");
    }

    public Animal(String name) {
        System.out.println("Animal得有参构造");
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public String toString() {
        return "Animal{" +
                "name='" + name + '\'' +
                '}';
    }

    public void spark(){

    }
}
